home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13298 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: solon.com!not-for-mail
  2. From: Michael Smith <msmith@mpx.com.au>
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 6 Apr 1996 09:01:50 -0600
  6. Organization: Emmenjay Consulting
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4k610u$al9@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com> <4j41ru$nq4@solutions.solon.com> <4jttlq$3p1@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12. X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
  13.  
  14. Niall Smart wrote:
  15.  > or either of:
  16.  > 
  17.  > while (p < end_p)
  18.  > {
  19.  >         (*p)++;
  20.  >         p++;
  21.  > }
  22.  > 
  23.  > while (p++ < end_p)
  24.  > {
  25.  >         (*p)++;
  26.  > }
  27.  > I don't think that the last example is correct.  
  28. While the comparison of p and end_p will occur before the incrementing of 
  29. p, the expression (*p)++ will be evaluated AFTER p ha been incremented (I 
  30. think???).  This is not the same as the earlier examples.
  31.  
  32.  
  33.  
  34. -- 
  35. #####################################################################
  36. Michael Smith                                       msmith@mpx.com.au
  37. Emmenjay Consulting                 http://www.hutch.com.au/~emmenjay
  38. #####################################################################
  39.